{% extends "base.html" %}


{% block content %}


<b>Version:</b> {{version}}
<div class="info">
  <pre id=status>
    No log entry
  </pre>
</div>


<input id="arg" placeholder="enter url here" type=search size=80 />

<button command="openurl" type=button class=midbutton>Open URL</button>



<script>
$(function() {
    console.log("chrome setup");

    function SetStatus(data, html_status) {
        console.log("command completed [" + html_status + "]");
        console.log("command completed [" + data + "]");
        $("#status").html(data);
    }

    function SendCommand(command, arg) {
        console.log(command + " " + arg);
        $.get("/chrome_command", {command: command, arg: arg}, SetStatus);
    }

    function ButtonClick() {
         var command = $(this).attr("command");
         var arg = $("#arg").val();
         console.log("arg is ["  + arg + "]");
         SendCommand(command, arg);
    }

     $("button").click(ButtonClick);
 });

 </script>

{% end %}
